<!DOCTYPE html>
<html>
    <head>
        <title><%= title %></title>
        <link rel='stylesheet' href='/css/style.css' />
    </head>
    <body>
        <h1><%= title %></h1>
        <button id="btn">222</button>
            <form action="/login/login" method="POST">
                <p>username: <input type="text" name="username" value="admin"/></p>
                <p>password: <input type="text" name="password" value="123"/></p>
                <input type="submit" value="Submit" />
            </form>
    </body>
    <script src="js/jquery-3.0.0.min.js"></script>
    <script>
    $("#btn").on("click",function(){
        $.ajax({
            type:"post",
            url:"/login/login",
            data:{
                "username":"admin",
                "password":"123"
            },
            dataType:"json",
            success:function(res){
                alert(JSON.stringify(res));
            },
            error:function(res){
                alert(JSON.stringify(res));
            }
        })
    });
    </script>
</html>
